/****** Script for SelectTopNRows command from SSMS ******/ SELECT TOP 1000 [AADHAR] ,[NAME] ,[AGE] ,[PINCODE] ,[DOB] ,[PAN] ,[created_on] FROM [IRCTC].[dbo].[VOTERLIST] where name not like 'C%T' --Starts with C, Ends with T, inbetween any number character Where columnName = 'Value' Where columnName = 10 Where columnName = '2022-01-01' Where columnName = 'Value' and columnName1 = 'Value1' Where columnName = 'Value' or columnName1 = 'Value1' Where columnName > 100 and columnName1 <> 'Value1' Where columnName like 'V%e' Where columnName not like 'V_e' Where columnName in (1,2,3) Where columnName not in (1,2,3) Where columnName between 2 and 5 Where columnName not between 2 and 5 Where columnName IS NULL Where columnName IS NOT NULL --DML --> Data Manipulation Language --Following update statement will update all records of table as no where condition given Update tableName set Col1 = Val1, Col2 = 'Val' --Following update statement will update records of table which are selected with where condition Update tableName set Col1 = Val1, Col2 = 'Val' Where columnName = 'Value'; select * from Voterlist where PAN is null update voterlist set PAN = 'XYZ' where PAN is null --Delete data from table --Below delete statement deletes all the records from the table delete from tableName --Below delete statement deletes only matched records through where clause condition delete from tableName where col1 = 'Val1' select * from Voterlist where dob is null delete from Voterlist where dob is null select * from Voterlist alter table voterlist add CitizenType varchar(30) update citizentype 'Senior Citizen' condition age greaterthanequals to 60 years update voterlist set citizentype = 'Senior Citizen' where age >= 60 select * from voterlist where age >= 60 select * from voterlist where age between 40 and 59 update voterlist set citizentype = 'Middle Age' where age between 40 and 59 select * from voterlist where citizentype is null and DOB >= '1990-01-01' update voterlist set citizentype = 'Youngster' where citizentype is null and DOB >= '1990-01-01' select * from voterlist where citizentype is null delete from VOTERLIST where citizentype is null